//
//  MarkupBoot.swift
//  SwiftUIWidgetDemo
//
//  Created by alanzhangg on 2023/7/18.
//

import SwiftUI

struct MarkupBoot: View {
    
    //MARK: PROPERTIES
    
    @State var data: [String] = [
        "apples", "oranges", "bananas"
    ]
    @State var showAlert: Bool = false
    
    //MARK: BODY
    //Working copy - things to do
    /*
     //1 fix title
     //2 fix alert
     */
    
    var body: some View {
        NavigationStack {
            VStack{ //START: VSTACK
                Text("hello")
                ForEach(data, id: \.self) { name in
                    Text(name)
                        .font(.headline)
                }
            }//END: VSTACK
            .navigationTitle("Documents")
            .toolbar {
                ToolbarItem(placement: .topBarLeading) {
                    Button("ALERT") {
                        showAlert.toggle()
                    }
                }
            }
            .alert("alert", isPresented: $showAlert, actions: {
                
            })
        }
    }
}


//MARK: PREVIEW
#Preview {
    MarkupBoot()
}
